package com.lan.model.symbol;

import com.lan.model.Symbol;
import org.antlr.v4.runtime.ParserRuleContext;

import java.util.LinkedList;
import java.util.List;

public class Function extends Scope {

    // 参数
    private List<Symbol> parameters = new LinkedList<>();

    private Variable rv;

    public Function(String id, String name, Scope scope, ParserRuleContext ctx) {
        this.id = id;
        this.name = name;
        this.scope = scope;
        this.ctx = ctx;
    }

    @Override
    public String toString() {
        return "Function->" + id;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public Scope getScope() {
        return scope;
    }

    public List<Symbol> getParameters() {
        return parameters;
    }

    public Variable getRv() {
        return rv;
    }

    public void setRv(Variable rv) {
        this.rv = rv;
    }
}